package chapter05

/**
 *
 * @author cdhuangchao3
 * @date 2023/6/4 7:24 PM
 */
object Test03_FunctionParameter {
  def main(args: Array[String]): Unit = {
    def f1(str: String*): Unit = {
      println("f1:" + str)
    }

    f1("zs")
    f1("zs", "ls")

    def f2(str1: String, str2: String*): Unit = {
      println("f1:" + str1 + " str2:" + str2)
    }

    f2("zs", "ls")

    def f3(str1: String = "hello"): Unit = {
      println("f3 - " + str1)
    }

    f3("hi")
    f3()

    def f4(name: String, age: Int): Unit = {
      println(s"f4: name:${name} age:${age}")
    }

    f4(age = 3, name = "zs")
  }
}
